﻿Namespace Seguranca.Dominio

    ''' <summary>
    ''' Classe Usuário de Segurança
    ''' </summary>
    ''' <remarks></remarks>
    <Serializable()> _
    Public Class Usuario

        Private _id As Long

        ''' <summary>
        ''' Identificador da Segurança
        ''' </summary>
        ''' <value>Long</value>
        ''' <returns>Long</returns>
        ''' <remarks></remarks>
        Public Overridable Property Id() As Long
            Get
                Return _id
            End Get
            Set(ByVal value As Long)
                _id = value
            End Set
        End Property

        Private _papeis As IList(Of Papel)
        ''' <summary>
        ''' Propriedade _papeis
        ''' </summary>
        ''' <value>Lista(classe Papel)</value>
        ''' <returns>Lista(classe Papel)</returns>
        ''' <remarks></remarks>
        Public Overridable Property Papeis() As IList(Of Papel)
            Get
                Return _papeis
            End Get
            Set(ByVal value As IList(Of Papel))
                _papeis = value
            End Set
        End Property

        Public Overridable Sub adicionaPapel(ByVal _papel As Papel)
            If IsNothing(_papeis) Then
                _papeis = New List(Of Papel)
            End If
            _papeis.Add(_papel)
        End Sub

        Private _email As String
        Public Overridable Property Email() As String
            Get
                Return _email
            End Get
            Set(ByVal value As String)
                _email = value
            End Set
        End Property

        Private _Nome As String
        Public Overridable Property Nome() As String
            Get
                Return _Nome
            End Get
            Set(ByVal value As String)
                _Nome = value
            End Set
        End Property

        Private _Senha As String
        Public Overridable Property Senha() As String
            Get
                Return _Senha
            End Get
            Set(ByVal value As String)
                _Senha = value
            End Set
        End Property

        Private _Ativo As Nullable(Of Boolean)
        Public Overridable Property Ativo() As Nullable(Of Boolean)
            Get
                Return _Ativo
            End Get
            Set(ByVal value As Nullable(Of Boolean))
                _Ativo = value
            End Set
        End Property

        Private _DataInclusao As Nullable(Of Date)
        Public Overridable Property DataInclusao() As Nullable(Of Date)
            Get
                Return _DataInclusao
            End Get
            Set(ByVal value As Nullable(Of Date))
                _DataInclusao = value
            End Set
        End Property

    End Class

End Namespace